package org.yenn.pattern.aliyun.structural.proxy.impl;

import org.yenn.pattern.aliyun.structural.proxy.Image;

/**
 * 步骤 2
 * 创建实现接口的实体类
 */
public class RealImage implements Image {
    private String fileName;

    public RealImage(String fileName) {
        this.fileName = fileName;
        loadFromDisk(fileName);
    }

    @Override
    public void display() {
        System.out.println("Displaying " + fileName);
    }

    private void loadFromDisk(String fileName) {
        System.out.println("Loading " + fileName);
    }
}